package com.gdssoft.pdaweb.dao.water.impl;

/*
 *  捷达世软件(深圳)有限公司
 *  Copyright (C) 2008-2010 ShenZhen JieDaShi Software Limited Company.
 */

import java.util.List;

import com.gdssoft.core.dao.impl.BaseDaoImpl;
import com.gdssoft.pdaweb.dao.water.WaterMeterMonthPlanDao;
import com.gdssoft.pdaweb.model.water.WaterMeterMonthPlan;

@SuppressWarnings("unchecked")
public class WaterMeterMonthPlanDaoImpl extends BaseDaoImpl<WaterMeterMonthPlan> 
implements WaterMeterMonthPlanDao {

	public WaterMeterMonthPlanDaoImpl() {
		super(WaterMeterMonthPlan.class);
	}

	@Override
	public List<WaterMeterMonthPlan> getByPlanId(Long id) {
		String hql="from WaterMeterMonthPlan where planId=?";
		return this.findByHql(hql, new Object[]{id});
	}
	/*
	@Override
	public WaterMeterMonthPlan getByIdAndMonth(Long planId, String month) {
		String hql="from WaterMeterMonthPlan where planId=? and month=?";
		return (WaterMeterMonthPlan) this.findUnique(hql, new Object[]{planId, month});
	}
	*/
	@Override
	public List<WaterMeterMonthPlan> getByIdAndStatus(Long id,Long status) {
		String hql="from WaterMeterMonthPlan where planId=?and planStatus=?";
		return this.findByHql(hql, new Object[]{id, status});
	}

	@Override
	public List<WaterMeterMonthPlan> getByPlanIdAndMonth(Long planId,
			String thisMonth) {
		String hql="from WaterMeterMonthPlan where planId='"+planId+"' and month='"+thisMonth+"'";
		return this.findByHql(hql);
	}
}
